import request from '@/utils/request'

// 获取品牌列表 (分页)
export function getBrandList(params) {
  return request({
    url: '/brand/list',
    method: 'GET',
    params
  })
}

// 根据ID获取品牌详情
export function getBrandById(id) {
  return request({
    url: `/brand/${id}`,
    method: 'GET'
  })
}

// 新增品牌
export function addBrand(data) {
  return request({
    url: '/brand',
    method: 'POST',
    data
  })
}

// 更新品牌
export function updateBrand(data) {
  return request({
    url: '/brand',
    method: 'PUT',
    data
  })
}

// 删除品牌
export function deleteBrand(id) {
  return request({
    url: `/brand/${id}`,
    method: 'DELETE'
  })
}

// 批量删除品牌
export function batchDeleteBrands(ids) {
  return request({
    url: '/brand/batch',
    method: 'DELETE',
    data: ids
  })
}

// 更新品牌状态
export function updateBrandStatus(id, status) {
  return request({
    url: `/brand/${id}/status`,
    method: 'PUT',
    params: { status }
  })
}

